<template>
  <div>
    <!-- This is score analyse page! -->

    <el-main>
    <!-- 面包屑 -->
    <div class="bg-breadcrumb">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/teacher/teacherhomepage' }"
          >首页</el-breadcrumb-item
        >
        <el-breadcrumb-item>分数分析</el-breadcrumb-item>
      </el-breadcrumb>
    </div>

    <el-card
      shadow="always"
      style="margin-top: 20px;"
      :body-style="{ padding: '20px' }">

      <!-- 列出教师的可打分记录 -->
      <el-table
        :data="examList"
        style="width: 100%;"
        :header-cell-style="{background:'#F3F4F7'}"
        border>
        <el-table-column
          label="课程编号"
          align="center"
          prop="course_teacher_num"
          width="100">
        </el-table-column>
        <!-- 课程名 -->
        <el-table-column
          label="课程名称"
          align="center"
          prop="course_name"
          width="180">
        </el-table-column>
        <el-table-column
          prop="genre"
          align="center"
          label="课程分类">
        </el-table-column>
        <el-table-column
          prop="school_name"
          align="center"
          label="开课学院"
          width="180">
        </el-table-column>
        <el-table-column
          prop="class_name"
          align="center"
          label="开课专业">
        </el-table-column>
        <el-table-column
          width="200"
          align="center"
          label="操作">
          <template slot-scope="scope">
            <el-button size="mini" @click="toCheckScore(scope.row)">查看</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>

    </el-main>

  </div>
</template>

<script>
const echarts = require('echarts')
export default {
  data () {
    return {
      examNum: 0,
      examList: []
    }
  },
  created () {
    this.getExamList()
  },
  mounted () {

  },
  methods: {
    async getExamList () {
      const { data: res } = await this.$http.post(`score/teacher/getScoreList?page=0&rows=10`)
      console.log(res)
      if (!res.state) return this.$message.error(res.msg)
      this.examList = res.detail.list
    },

    toCheckScore (exam) {
      window.localStorage.setItem('examId', exam.id)
      this.$router.push('/teacher/scoredetail')
    }
  }
}
</script>

<style lang="less" scoped>
</style>
